package com.wuad.platformwuad.module.user.controller;

import com.wuad.platformwuad.common.Result;
import com.wuad.platformwuad.module.user.entity.UserEntity;
import com.wuad.platformwuad.module.user.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * user控制器
 *
 * @author wuaodi
 */
@RequestMapping(value = "/user")
@Slf4j
@RestController
public class UserController {

    @Resource
    private UserService userService;

    @GetMapping("/getUser")
    public Result getUser(@RequestParam(value = "id") String id) {
        UserEntity userEntity = userService.getUser(id);
        log.info("userEntity:{}", userEntity);
        return  Result.success(200, userEntity);
    }

}
